//
//  AppInfoManager.m
//  much
//
//  Created by weijunjie on 2018/12/29.
//  Copyright © 2018年 iOS. All rights reserved.
//

#import "AppInfoManager.h"
#import "DeviceInfoManager.h"

@implementation AppInfoManager
- (iPhoneType)iPhoneType {
    NSString *iPhoneName = [DeviceInfoManager currentDeviceName];
    iPhoneType type = iPhoneUniversal;
    if ([iPhoneName isEqualToString:@"iPhone X"] || [iPhoneName isEqualToString:@"Simulator"] || [iPhoneName isEqualToString:@"iPhone XS"] || [iPhoneName isEqualToString:@"iPhone XS Max"] || [iPhoneName isEqualToString:@"iPhone XR"]) {
        type = iPhoneX;
    }
    return type;
}

- (NSString *)applicationVersion {
    return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
}

+ (instancetype)instance {
    static dispatch_once_t onceToken;
    static AppInfoManager *onceObject;
    dispatch_once(&onceToken, ^{
        onceObject = [[AppInfoManager alloc] init];
    });
    return onceObject;
}


@end
